﻿using DomainModel;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;

namespace Infrastructure.Mapper
{
    public class LinksConfiguration : EntityTypeConfiguration<LinksInfo>
    {
        public LinksConfiguration()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Title)
                .HasMaxLength(50);

            this.Property(t => t.Url)
                .HasMaxLength(100);

            this.Property(t => t.ImgUrl)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("CTB_LinksInfo");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.CompanyId).HasColumnName("CompanyId");
            this.Property(t => t.Title).HasColumnName("Title");
            this.Property(t => t.Url).HasColumnName("Url");
            this.Property(t => t.ImgUrl).HasColumnName("ImgUrl");
            Property(t => t.Types);
        }
    }
}
